/* ECharts 图表样式定制 */

/* 图表容器基础样式 */
.echarts-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 图表加载状态 */
.echarts-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    border-radius: 4px;
}

.echarts-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.echarts-loading .loading-text {
    margin-left: 10px;
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 图表工具提示样式 */
.echarts-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 12px !important;
}

.echarts-tooltip .tooltip-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.echarts-tooltip .tooltip-item {
    display: flex;
    align-items: center;
    margin: 4px 0;
    font-size: 13px;
}

.echarts-tooltip .tooltip-marker {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
}

.echarts-tooltip .tooltip-name {
    color: #666;
    margin-right: 8px;
}

.echarts-tooltip .tooltip-value {
    color: #333;
    font-weight: 500;
}

/* 图表图例样式 */
.echarts-legend {
    padding: 8px 0 !important;
}

.echarts-legend-item {
    margin-right: 16px !important;
    margin-bottom: 4px !important;
}

.echarts-legend-text {
    font-size: 12px !important;
    color: #666 !important;
}

/* 图表坐标轴样式 */
.echarts-axis-line {
    stroke: #e8e8e8 !important;
}

.echarts-axis-tick {
    stroke: #e8e8e8 !important;
}

.echarts-axis-label {
    font-size: 12px !important;
    color: #666 !important;
}

.echarts-axis-name {
    font-size: 12px !important;
    color: #999 !important;
}

/* 图表网格线样式 */
.echarts-grid-line {
    stroke: #f0f0f0 !important;
    stroke-dasharray: 3, 3 !important;
}

/* 数据可视化颜色主题 */
.echarts-color-primary {
    color: #5470c6 !important;
}

.echarts-color-success {
    color: #91cc75 !important;
}

.echarts-color-warning {
    color: #fac858 !important;
}

.echarts-color-danger {
    color: #ee6666 !important;
}

.echarts-color-info {
    color: #73c0de !important;
}

/* 饼图专用样式 */
.echarts-pie-label {
    font-size: 12px !important;
    color: #333 !important;
}

.echarts-pie-label-line {
    stroke: #ccc !important;
}

/* 柱状图专用样式 */
.echarts-bar-item {
    border-radius: 2px !important;
}

/* 折线图专用样式 */
.echarts-line-symbol {
    border: 2px solid #fff !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .echarts-tooltip {
        max-width: 200px !important;
        font-size: 12px !important;
    }
    
    .echarts-legend {
        text-align: center !important;
    }
    
    .echarts-legend-item {
        margin-right: 8px !important;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .echarts-tooltip {
        background: rgba(45, 45, 45, 0.95) !important;
        border-color: #444 !important;
        color: #fff !important;
    }
    
    .echarts-tooltip .tooltip-title,
    .echarts-tooltip .tooltip-value {
        color: #fff !important;
    }
    
    .echarts-tooltip .tooltip-name {
        color: #ccc !important;
    }
    
    .echarts-axis-line,
    .echarts-axis-tick {
        stroke: #444 !important;
    }
    
    .echarts-axis-label,
    .echarts-axis-name {
        color: #999 !important;
    }
    
    .echarts-grid-line {
        stroke: #333 !important;
    }
}

/* 无障碍访问支持 */
.echarts-container:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .echarts-tooltip {
        border-width: 2px !important;
    }
    
    .echarts-axis-line,
    .echarts-axis-tick {
        stroke-width: 2px !important;
    }
}